import request from './request.js';

export default{
    //获取建议列表
    ///community/user/community/{openId}
    getCommunity(query){
        return request({
            url: BASE+`/community/user/community/${openid}`,
            method: 'get',
            params:query
        }) 
    },
    getData(query){
        return request({
            url: BASE+'/community/user/community',
            method: 'POST',
            params:query
        }) 
    },
    getOn(query){
        return request({
            url: BASE+'/wx/getPermission',
            method: 'get',
            data:query,
            params:query
        }) 
    },
    getOpenID(query){
        return request({
            url: BASE+'/wx/getOpenIdBaseInfoByCode',
            method: 'get',
            params:query
        })
    },
    getInfo(query){
        return request({
            url: BASE+`/publicUser/info/${openid}`,
            method: 'get'
        })
    },
    update(query){
        return request({
            url: BASE+'/publicUser/update',
            method: 'put',
            data:query
        })
    },
    
    add(query){
        return request({
            url: BASE+'/publicUser/save',
            method: 'post',
            data:query
        })
    },
    getVillage(query){
        return request({
            url: BASE+'/community/queryAllCommunity',
            method: 'get'
        })
    },
    getLouDong(query){
        return request({
            url: BASE+`/community/queryAllBuilding/${query.id}`,
            method: 'get'
        })
    },
    getHouseBy(query){
        return request({
            url: BASE+`/community/queryAllHouse/${query.id}`,
            method: 'get'
        })
    },
    addNewguanlian(query){
        return request({
            url: BASE+`/community/user/community`,
            method: 'post',
            data:query
        })
    },
    updateguanlian(query){
        ///community/user/community
        return request({
            url: BASE+`/community/user/community`,
            method: 'put',
            data:query
        })
    },
    delhouse(query){
        ///community/user/community
        return request({
            url: BASE+`/community/user/community`,
            method: 'delete',
            data:query
        })
    },
    updatehouse(query){
        ///community/user/community
        return request({
            url: BASE+`/community/user/community`,
            method: 'put',
            data:query
        })
    },
    getHouse(query){
        ///community/user/community
        return request({
            url: BASE+`/community/user/communityDetail/${query.id}`,
            method: 'get',
            data:query
        })
    },
    getPermision(query){
        ///community/user/community
        return request({
            url: BASE+`/publicUser/getUserPermission`,
            method: 'post',
            params:query
        })
    }
}